﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using LanceZhang.Research.BLL;
using LanceZhang.Research.Model;

public partial class UserControl_EncouragementParticular : System.Web.UI.UserControl
{
    TBL_Honour hc = new TBL_Honour();
    TBL_HonourModel h = new TBL_HonourModel();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["id"] != null)
        {
            h = hc.GetModelByCache(Request["id"]);
            lblName.Text = h.HonName;
            lblDate.Text = h.AwardDate.ToShortDateString();
            lblORG.Text = h.DeptName;
            li.Text = h.Content;

            string pid = (h.ProjectID).Substring(0, 1);

            if (pid == "B")
            {
                TBL_Book pc = new TBL_Book();
                TBL_BookModel p = pc.GetModelByCache(h.ProjectID);
                lblPType.Text = "论著";
                lblLevel.Text = p.LevelName;

                hlPName.Text = p.BookName;
                hlPName.NavigateUrl = "~/BookDetail.aspx?id="+p.ProjectID;
                hlPName.Target = "_blank";
            }
            else if (pid == "D")
            {
                TBL_Dissertation pc = new TBL_Dissertation();
                TBL_DissertationModel p = new TBL_DissertationModel();
                lblPType.Text = "论文";
                TBL_Magazine mc=new TBL_Magazine();
                lblLevel.Text = mc.GetModelByCache(p.ISSN).LevelName;

                hlPName.Text = p.DisName;
                hlPName.NavigateUrl = "~/DissertationDetail.aspx?id=" + p.ProjectID;
                hlPName.Target = "_blank";
            }
            else
            {
                TBL_Reserch pc = new TBL_Reserch();
                TBL_ReserchModel p = new TBL_ReserchModel();
                lblPType.Text = "课题";
                lblLevel.Text=p.LevelName;

                hlPName.Text = p.ResName;
                hlPName.NavigateUrl = "~/ResearchDetail.aspx?id=" + p.ProjectID;
                hlPName.Target = "_blank";
            }

        }
    }
}
